<?php
define('ROOT', dirname(__FILE__));
$uri = $_SERVER['REQUEST_URI'];
$arr = explode('?', $uri);
$file = ROOT.$arr[0].'.php';
if (strpos($arr[0], '/api') === 0 && file_exists($file)) {
    include $file;
} else {
    echo json_encode(['error' => '错误请求'], 256);
}
